﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace IRCBot
{
    public class Maps :  CollectionBase
    {
        public Maps()
        {
            Map badlands = new Map() { Id = 0, Name = "cp_badlands" };
            this.Add(badlands);
            Map granary = new Map() { Id = 1, Name = "cp_granary" };
            this.Add(granary);
            Map freight = new Map() { Id = 2, Name = "cp_freight_final1" };
            this.Add(freight);
            Map gully = new Map() { Id = 3, Name = "cp_gullywash_imp3" };
            this.Add(gully);
        }

        public virtual void Add(Map map)
        {
            this.List.Add(map);
        }

        public virtual Map this[int index]
        {
            get
            {
                return (Map)this.List[index];
            }
        }

        public virtual Map this[String name]
        {
            get
            {
                foreach (Map map in this.List)
                {
                    if (map.Name == name)
                        return map;
                }
                return null;
            }
        }
    }
}
